/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.lsp.obey;

import junit.framework.Assert;
import org.springframework.context.ApplicationContext;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import za.ac.cput.lsp.obey.config.CalcConf2;
import za.ac.cput.lsp.obey.service.internal.ImprovedCalc;

/**
 *
 * @author Jameel
 */
public class CalcJUnitTest2 {
    
    private static ApplicationContext ctx;
    private static ImprovedCalc calcImp;
    
    public CalcJUnitTest2() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctx = new AnnotationConfigApplicationContext(CalcConf2.class);
        calcImp = (ImprovedCalc)ctx.getBean("calc2");
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
    @Test
    public void calc() {
        ImprovedCalc myCalc = new ImprovedCalc();
        
        Assert.assertEquals(5, myCalc.subtract(10, 5));               
    }
}
